package com.qf.fmall2203.introducepro.controller;

import com.qf.fmall2203.introducepro.entity.Product;
import com.qf.fmall2203.introducepro.mapper.ProductMapper;
import com.qf.fmall2203.utils.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 商品 商品信息相关表：分类表，商品图片表，商品规格表，商品参数表 前端控制器
 * </p>
 *
 * @author CM
 * @since 2023-02-14
 */
@RestController
@RequestMapping("/index")
@CrossOrigin
public class ProductController {

    @SuppressWarnings("SpringJavaInjectionPointsAutowiringInspection")
    @Autowired
    ProductMapper productMapper;

    @GetMapping("/list-recommends")
    public ResultVo getIntroducePro(){

        List<Product> products = productMapper.selectProduct();

        return ResultVo.ok(products);
    }


}
